<template>
  <div>
    <project-detail v-show="is_detail" :is-edit="true" style="padding: 30px 45px 0px 100px;" />
    <audit-detail v-show="is_audit" :is-audit="is_audit" />
    <stay-tender v-show="is_stay_tender" :is_stay_tender="is_stay_tender" />
    <stay-preparation
      v-show="is_stay_preparation"
      :is_stay_preparation="is_stay_preparation"
    />
    <project-tender v-show="is_tender" :is_tender="is_tender" />
    <project-signed v-show="is_signed" :is_signed="is_signed" />
    <project-comment v-show="is_comment" :is_comment="is_comment" />
    <sign-audit v-show="is_sign_audit" :is_sign_audit="is_sign_audit" />

    <div v-show="diaplayBtn" style="text-align: center; padding: 20px">
      <el-button
        style="margin-left: 10px"
        type="success"
        @click="goBack()"
      >返回</el-button>
    </div>
  </div>
</template>

<script>
import ProjectDetail from './components/detail'
import AuditDetail from './components/audit'
import ProjectComment from './components/comment'
import ProjectTender from './components/tender'
import ProjectSigned from './components/signed'
import SignAudit from './components/sign_audit'
import StayTender from './components/stay_tender'
import StayPreparation from './components/stay_preparation'

export default {
  name: 'EditForm',
  components: {
    ProjectDetail,
    AuditDetail,
    ProjectComment,
    ProjectTender,
    ProjectSigned,
    SignAudit,
    StayTender,
    StayPreparation
  },
  data() {
    return {
      is_detail: false,
      is_audit: false,
      is_comment: false,
      is_tender: false,
      is_signed: false,
      diaplayBtn: false,
      is_sign_audit: false,
      is_stay_tender: false,
      is_stay_preparation: false
    }
  },

  created() {
    const value = this.$route.query.value
    const status = this.$route.query.status
    // let id = this.$route.query.id;
    if (value == '1') {
      this.is_comment = true
      this.is_detail = true
      this.is_audit = true
      this.is_comment = true
      this.is_tender = true
      this.is_signed = true
      this.diaplayBtn = true
      this.is_stay_tender = true
      this.is_stay_preparation = true
    } else if (value == '2') {
      // 审核
      this.is_detail = true
      this.is_audit = true
    } else if (value == '3') {
      // 项目评价
      this.is_detail = true
      this.is_audit = true
      this.is_comment = true
    } else if (value == '4') {
      // 投标中
      this.is_detail = true
      this.is_tender = true
    } else if (value == '5') {
      // 签约中
      this.is_detail = true
      this.is_signed = true
    } else if (value == '11') {
      // 签约审核
      this.is_detail = true
      this.is_sign_audit = true
      this.is_signed = true
    } else if (value == '8') {
      // 待投标
      this.is_detail = true
      // this.is_audit = true
      this.is_stay_tender = true
    } else if (value == '9') {
      this.is_detail = true
      this.is_stay_preparation = true
    }
  },
  methods: {
    goBack() {
      this.$router.go(-1)
    }
  }
}
</script>
<style></style>
